<?php
session_start();
require($_SERVER['DOCUMENT_ROOT'].'/resources/lib/database.php');
require($_SERVER['DOCUMENT_ROOT'].'/resources/lib/functions.php');
require($_SERVER['DOCUMENT_ROOT'].'/resources/lib/class.admin.php');
$admin = new admin();
$admin->canView($_SERVER['PHP_SELF']);
$oid=$_GET['oid'];
$rand=time();
?>
<div class="oneem">
<div class="qt-tab-wrapper" style="height:395px;">
<ul class="qt">
<li><a href="#images-gallery" id="ttt2" class="qta">Gallery</a></li>

<li><a href="#images-upload" id="ttt1" class="qta">Upload</a></li>
</ul>
<div id="images-gallery" class="qt-content-container" style="display:none;">Gallery</div>

<div id="images-upload" class="qt-content-container" style="display:none;">
	<h2 class="form-heading">Upload new media</h2>
    <form target="upload_frame_<?php echo($rand); ?>" method="post" action="/admin/resources/php/requests/actions/upload_media.php" enctype="multipart/form-data">
    <input type="file" name="media" id="media" />
    <input type="hidden" name="content_editor" id="content_editor" value="<?php echo($oid); ?>" />
    <input type="submit" class="button" value="Upload" />
    </form>
    <iframe style="display:none;" name="upload_frame_<?php echo($rand); ?>" id="upload_frame_<?php echo($rand); ?>"></iframe>
</div>

</div>
</div>
<script>
load_media_gallery("#images-gallery","<?php echo($oid); ?>");
$("#ttt2").click();
</script>